#import "XenonDazzleController.h"
        
#import "XenonDazzleModel.h"
#import "XenonDazzleCell.h"
#import "Masonry.h"

@interface XenonDazzleController () <UICollectionViewDataSource, UICollectionViewDelegate>

@property (nonatomic, strong) UICollectionView *quirkNostalgiaCollectionView;
@property (nonatomic, strong) NSMutableArray *yarnArr;

@end

@implementation XenonDazzleController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self rippleSetupui];
	[self keenUnwindMotionrequestData];
}


//: 初始化页面UI
- (void)rippleSetupui {
	[self.view addSubview:self.quirkNostalgiaCollectionView];
	[self.quirkNostalgiaCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.edges.equalTo(self.view);
	}];
}


//: 获取数据模型
- (void)keenUnwindMotionrequestData {
	
}

- (UICollectionView *)quirkNostalgiaCollectionView {
    if (!_quirkNostalgiaCollectionView) {
        UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
        flowLayout.minimumLineSpacing = 10;
        flowLayout.minimumInteritemSpacing = 10;
        flowLayout.itemSize = CGSizeMake(100, 100);
        flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
        
        _quirkNostalgiaCollectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
        _quirkNostalgiaCollectionView.backgroundColor = UIColor.clearColor;
        _quirkNostalgiaCollectionView.delegate = self;
        _quirkNostalgiaCollectionView.dataSource = self;
        _quirkNostalgiaCollectionView.showsHorizontalScrollIndicator = NO;
        _quirkNostalgiaCollectionView.showsVerticalScrollIndicator = NO;
        [_quirkNostalgiaCollectionView registerClass:[XenonDazzleCell class] forCellWithReuseIdentifier:NSStringFromClass([XenonDazzleCell class])];
    }
    return _quirkNostalgiaCollectionView;
}

//: 懒加载数据模型数组
- (NSMutableArray *)yarnArr {
	if (!_yarnArr) {
		_yarnArr = [NSMutableArray array];
	}
	return _yarnArr;
}

#pragma mark - UICollectionView DataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return self.yarnArr.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    XenonDazzleCell *nirvanaDreamer = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XenonDazzleCell class]) forIndexPath:indexPath];
    return nirvanaDreamer;
}

#pragma mark - UICollectionView Delegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    //: collectioncell 点击
}


@end
